package com.hry.store.cms.service.impl;

import com.hry.store.cms.dao.AdminUserMapper;
import com.hry.store.cms.pojo.AdminUser;
import com.hry.store.cms.service.AdminUserService;
import com.hry.store.cms.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminUserServiceImpl implements AdminUserService {
    @Autowired
    private AdminUserMapper adminUserMapper;

    /**
     * 管理登录
     * @param email
     * @param password
     * @return
     */
    @Override
    public AdminUser selectByEmailAndPassword(String email, String password) {
        AdminUser adminUser = adminUserMapper.selectByEmailAndPassword(email, MD5Util.MD5EncodeUtf8(password));
        if (adminUser == null) {
            return null;
        }
        return adminUser;
    }
}
